home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
edit
/
me_cd25.zip
/
ME2MUTT.ZIP
/
SAVEALL.MUT
< prev
next >
Wrap
Text File
|
1992-11-09
|
1KB
|
52 lines
;; saveall.mut : various ways of saving buffers
; save-all: save all modified buffers that can be saved
; ask-save-and-exit: save modified buffers user wants to save
; and exit.
; If the key-pressed-hook is installed, a save-all is done
; every n key presses.
; All these ignore buffers that are not attached to files.
; C Durland Public Domain
;;;!!! this is old stuff that needs updating!
(defun
save-all
{
(int j)
(for (j 0) (< j (buffers)) (+= j 1)
(if (and (buffer-modified j)(!= (file-name j) ""))
{
(current-buffer j)(save-buffer)
})
)
}
ask-save-and-exit
{
(int j n)
(n (buffers))(j 0)
(while (< j n)
{
(if (and (buffer-modified j)(!= (file-name j)""))
(if (yesno "Save "(buffer-name j) " [" (file-name j)"]") ()
(buffer-modified j FALSE))
)
(+= j 1)
})
(save-all)
(exit)
}
)
(const threshold 300) ; save after this many key presses
;(int keys-pressed) ; the number of keys pressed since the last save
;(defun
; key-pressed-hook
; {
; (if (> (+= keys-pressed 1) threshold) { (save-all)(keys-pressed 0) } )
; }
;)